package com.artPreter.pojo;

import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * <p>
 * 艺术家表
 * </p>
 *
 * @author jarvis
 * @since 2024-11-14
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("jv_artist")
public class Artist implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * ID
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     * 艺术家名称
     */
    private String name;

    /**
     * 艺术家uuid
     */
    private String artistId;

    /**
     * 创建人ID
     */
    private Integer createUser;

    /**
     * 创建时间
     */
    @TableField(fill = FieldFill.INSERT)
    private Integer createTime;

    /**
     * 修改时间
     */
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Integer updateTime;

    /**
     * 排序
     */
    private Integer sort;

    /**
     * 1:启用
     */
    private Integer status;

    /**
     * 模板uuid
     */
    private String tempId;


    /**
     * 是否推荐
     */
    private Integer isRecommend;


    /**
     * 机构名称集合
     */
    @TableField(exist = false)
    private String departName;


    /**
     * 艺术家加盟机构数量
     */
    @TableField(exist = false)
    private String num;

    /**
     * 拼音
     */
    private String pinyin;

    /**
     * 拼音首字母
     */
    private String firstPy;

    /**
     * 艺术家封面图片地址
     */
    private String url;

    /**
     * 机构对艺术品标签
     */
    private String artworkTags;


    /**
     * 机构对文章标签
     */
    private String articleTags;


    /**
     * 机构对图片标签
     */
    private String pictureTags;
    /**
     * 艺术家擅长类型
     */
    private String artistType;

    @TableField(exist = false)
    private String contentId;

    @TableField(exist = false)
    private String departId;

    @TableField(exist = false)
    private String eventId;

    private String indexContent;

    /**
     * 是否显示
     */
    private Integer isIndex;

    /**
     * 首页排序
     */
    private Integer indexSort;

    /**
     * 推荐排序
     */
    private Integer recommendSort;

    /**
     * 是否名家
     */
    private Integer isFamous;

    /**
     * 名家排序
     */
    private Integer famousSort;
    /**
     * 艺术家荣誉
     */
    private String honors;

    private String seoKeyworks;

    private String seoDescription;

    private String email;

    private String erweima2;

    private String phone;

    @TableField(exist = false)
    private Integer ctSort;

    /**
     * 二维码
     */
    private String erweima;

    @TableField(exist = false)
    private List<String> honorList;

    public String getHonors() {
        return honors;
    }

    public void setHonors(String honors) {
        if(honors==null||"".equals(honors)){
            this.honors = "";
            honors = "";
        }else{
            this.honors = honors;
            honors = honors.replace(",","，");
        }

        if(this.honors!=null&&!"".equals(this.honors)){
            List<String> honorList = new ArrayList<>();
            String[] strings = honors.split("，");
            for (String string : strings) {
                if(!string.equals("")&&string!=null){
                    honorList.add(string);
                }
            }
            this.honorList = honorList;



        }
    }
}
